%{
#include <stdio.h>
#include "decl.tab.h"
void yyerror(char *);
int yyparse(void);
%}

TYPE	"int"|"double"
ID	[a-z_][a-z0-9_]*
SEMICOLON	";"
COMMA	","


%%
{TYPE}	{printf("got a TYPE\n"); return TYPE;}
{ID}	{printf("got an ID\n"); return ID;}
{SEMICOLON}	{printf("got a SEMICOLON\n"); return SEMICOLON;}
{COMMA}	{printf("got a COMMA\n"); return COMMA;}
[ \t\n]+	{}
.	{yyerror("unsupported token\n");}

%%
void yyerror(char* e) {printf("ERROR: %s\n", e);exit(-1);}
int yywrap() {}

int main() {
	yyparse();
	return 0;
}
